import fetch from '@/utils/fetch'

export function getResidentList(areaIds, params) {
	return fetch({
	    url: '/uc/v1/mgt/resident',
	    method: 'get',
		headers: {'x-area-id': areaIds},
	    params
  	})
}

export function getResidentDetail(id) {
	return fetch({
	    url: `/uc/v1/mgt/resident/${id}`,
	    method: 'get'
  	})
}

export function createResident(data) {
	return fetch({
		url: '/uc/v1/mgt/resident',
		method: 'post',
		data
	})
}

export function modifyResident(id, data) {
	return fetch({
	    url: `/uc/v1/mgt/resident/${id}`,
	    method: 'patch',
	    data
	})
}

export const residentTypeList = {
	1: '业主',
	2: '家人',
	3: '朋友',
	4: '租客'
}

//删除员工信息操作
export function deleteResident(user_id){
	return fetch({
		url:`/uc/v1/mgt/resident/${user_id}`,
		method: 'DELETE'
	})
}
